package com.kc.business.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * FileName: BizMenu
 * Author:   TP
 * Date:     2020-10-30 07:59
 * Description: 菜单
 */
@Data
@Table(name = "kc_menu")
public class BizMenu {
    @Id
    private Integer id;

    /** 父级菜单ID */
    private Integer parentMenuId;

    /** 菜单类型，G:组 M:菜单 */
    @NotBlank(message = "菜单类型不能为空")
    @Size(min = 1, max = 1, message = "菜单类型只能1个字符")
    private String menuType;

    /** app应用的标识位 */
    @NotBlank(message = "菜单标识不能为空")
    @Size(min = 1, max = 7, message = "菜单标识不能超过7个字符")
    private String appFlagId;

    /** 菜单名称 */
    @NotBlank(message = "菜单名称不能为空")
    @Size(min = 1, max = 10, message = "菜单名称不能超过10个字符")
    private String menuName;

    /** 菜单链接地址 */
    @Size(max = 128, message = "菜单链接不能超过128个字符")
    private String menuLink;

    /** 菜单图标 */
    @Size(max = 128, message = "菜单图标不能超过128个字符")
    private String menuIcon;

    /** 菜单排序 */
    @NotNull(message = "菜单排序不能为空")
    private Integer menuSort;

    /** 是否是通用菜单 */
    private Integer isCommon;

    /** 是否为H5 */
    @NotNull(message = "请指定菜单是否为H5")
    private Integer isH5;

    /** 是否可用 */
    @NotNull(message = "请指定菜单是否可用")
    private Integer isVisible;

    /** 是否删除 */
    private Integer isDeleted;

    /** 创建人 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /** 修改人 */
    private String updateBy;

    /** 修改时间 */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
}
